package com.reading.common.entity.view;

import com.reading.common.entity.BaseObject;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;

@Getter
@Setter
@ToString
@NoArgsConstructor
public class BookChapter extends BaseObject {

    private Integer id;

    /**
     * 图书ID
     */
    @NotNull(message = "图书ID不得为空。")
    private Integer bookId;

    /**
     * 章节编号
     */
    private Integer chapterNumber;

    /**
     * 章节标题
     */
    @NotEmpty(message = "章节标题不得为空。")
    @Length(min = 1, max = 15, message = "章节标题字数应为1~15个字。")
    private String chapterTitle;

    /**
     * 章节字数
     */
    private Integer chapterSize;

    /**
     * 章节内容
     */
    @NotEmpty(message = "章节内容不得为空。")
    @Length(min = 15, max = 8000, message = "章节内容字数应为15~8000个字。")
    private String content;

}